﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:local="clr-namespace:MultitouchWPFDemo"
        xmlns:trenouth="clr-namespace:Trenouth.WPF.Behaviors"
        xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
        xmlns:Behaviours="clr-namespace:Trenouth.WPF.Behaviors;assembly=Trenouth.WPF.Behaviors"
        x:Name="window"
        x:Class="MultitouchWPFDemo.MainWindow"
        Title="MainWindow" Height="752" Width="774">
    <Grid>

        <Border BorderThickness="1" Background="#FF6EA1CB">
            <Grid>
                <Border x:Name="ObjectToTranslate" BorderBrush="White" BorderThickness="2" CornerRadius="5" Width="500" Height="200">
                	<Border.Background>
                		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                			<GradientStop Color="#FFA8A6CF" Offset="0" />
                			<GradientStop Color="#FF1810BD" Offset="1" />
                		</LinearGradientBrush>
                	</Border.Background>

                	<i:Interaction.Behaviors>
                		<Behaviours:MultitouchTransformBehavior x:Name="multitouchTransformBehavior" Duration="0:0:0.6" MinimumScale="0.5" />
                	</i:Interaction.Behaviors>
                	<TextBlock TextWrapping="Wrap" Foreground="White" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Margin="50"><Run Text="Drag, scale or rotate this object using your fingers :)" /></TextBlock>
                </Border>
                <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0,0,0,20">
                	<Button Content="Zoom Out" HorizontalAlignment="Left" VerticalAlignment="Top" Width="120" Height="30">
                		<i:Interaction.Triggers>
                			<i:EventTrigger EventName="Click">
                				<ei:CallMethodAction TargetObject="{Binding ElementName=multitouchTransformBehavior}" MethodName="ZoomOutStep"/>
                			</i:EventTrigger>
                		</i:Interaction.Triggers>
                	</Button>
                	<Button Content="Reset" HorizontalAlignment="Left" VerticalAlignment="Top" Width="120" Margin="10,0" Height="30">
                		<i:Interaction.Triggers>
                			<i:EventTrigger EventName="Click">
                				<ei:CallMethodAction TargetObject="{Binding ElementName=multitouchTransformBehavior}" MethodName="ResetWithAnimation"/>
                			</i:EventTrigger>
                		</i:Interaction.Triggers>
                	</Button>
                	<Button Content="Zoom In" HorizontalAlignment="Left" VerticalAlignment="Top" Width="120" Height="30">
                		<i:Interaction.Triggers>
                			<i:EventTrigger EventName="Click">
                				<ei:CallMethodAction TargetObject="{Binding ElementName=multitouchTransformBehavior}" MethodName="ZoomInStep"/>
                			</i:EventTrigger>
                		</i:Interaction.Triggers>
                	</Button>
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</Window>